package com.now.printer.ui.activity;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.now.printer.R;
import com.now.printer.base.BaseActivity2;
import com.now.printer.utils.ResUtils;

import org.xutils.common.util.LogUtil;

public class HelpDetailActivity extends BaseActivity2 {

    private TextView tvTitle;
    private ImageView ivDetail;

    public static final String INTENT_KEY_TITLE = "INTENT_KEY_TITLE";
    public static final String INTENT_KEY_DETAIL_IMAGE = "INTENT_KEY_DETAIL_IMAGE";
    public static final String INTENT_KEY_PAGE_TYPE = "INTENT_KEY_PAGE_TYPE";

    private ImageView fanhui;

    @Override
    public int getLayoutId() {
        return R.layout.activity_help_detail;
    }

    @Override
    public void doBusiness(Context mContext) {
        tvTitle = findViewById(R.id.tv_title);
        ivDetail = findViewById(R.id.iv_img_detail);
        fanhui = findViewById(R.id.fanhui);
        fanhui.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        tvTitle.setText(getIntent().getStringExtra(INTENT_KEY_TITLE));
        int position = getIntent().getIntExtra(INTENT_KEY_DETAIL_IMAGE , -1);
//        Drawable drawable = getResources().getDrawable(imgResId);

        int pageType = getIntent().getIntExtra(INTENT_KEY_PAGE_TYPE , 1);

        if (pageType == 1){
            Drawable[] mMenuIcons = ResUtils.getDrawableArray(this, R.array.item_click_help_printer);

            Glide.with(this).load(mMenuIcons[position]).into(ivDetail);
        }else {

        }

    }
}
